[ "MaxLength" => 32, "Link" => $TitleLink, "Heading" => "Title" ], "Events: Added By Id" => [ "Heading" => "Author" ], "Events: Last Modified By Id" => [ "Heading" => "Editor" ], "Events: Date Of Record Creation" => [ "Heading" => "Created" ], "Events: Date Last Modified" => [ "Heading" => "Modified" ], "Events: Release Flag" => [ "Heading" => "Rel.", "ValueFunction" => function ($Event) { return $Event->get('Release Flag') ? "Yes" : "No"; } ] ]; # retrieve existing search text $SearchText = defaulthtmlentities(StdLib::getFormValue("F_SearchText")); # prepare statistic message $SafePastEventsCount = defaulthtmlentities($H_EventCountsByTense["Past"]); $SafeOccurringEventsCount = defaulthtmlentities($H_EventCountsByTense["Occurring"]); $SafeFutureEventsCount = defaulthtmlentities($H_EventCountsByTense["Future"]); $StatisticMsg = ""; if ($H_EventCount > 0) { $StatisticMsg .= "Stats: ".$SafePastEventsCount." past " .StdLib::pluralize("event", $SafePastEventsCount).", " .$SafeOccurringEventsCount." " .StdLib::pluralize("event", $SafeOccurringEventsCount) ." currently occuring, and ".$SafeFutureEventsCount ." future ".StdLib::pluralize("event", $SafeFutureEventsCount); } # prepare search option list definition $SearchListName = "F_Field"; $SearchListSelected = StdLib::getFormValue("F_Field"); $SearchListOptions = [ "ALL" => "(any field)", "Title" => "Title", "ShortTitle" => "Short Title", "Description" => "Description", "URL" => "URL", "ContactEmail" => "Contact Email", "Venue" => "Venue", "Locality" => "City", "Region" => "State", "StartDate" => "Start Date", "EndDate" => "End Date", ]; $SearchList = new HtmlOptionList($SearchListName, $SearchListOptions, $SearchListSelected); # prepare condition option list definition $ConditionListName = "F_Condition"; $ConditionListSelected = StdLib::getFormValue("F_Condition"); $ConditionListOptions = [ "contains" => "contains", "equals" => "equals", "is before" => "is before", "is after" => "is after", ]; $ConditionList = new HtmlOptionList( $ConditionListName, $ConditionListOptions, $ConditionListSelected ); # config ItemListUI and render $ListUI = new ItemListUI($ListFields); $ListUI->baseLink($BaseLink); $ListUI->itemTypeName("Event"); $ListUI->heading("Calendar Events"); $ListUI->subheading($StatisticMsg); $ListUI->noItemsMessage("There are no events."); $ListUI->addActionButton("Edit", $EditLink); $ListUI->addActionButton("Delete", $DeleteLink); $ListUI->addTopButton("Add Event", $NewEventLink); $ListUI->itemsPerPage($H_EventsPerPage); ?>
Search: PrintHtml(); $ConditionList->PrintHtml(); ?>
display($H_Events, $H_EventCount, $H_StartingIndex);